<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once (dirname(__FILE__).DS.'helper.php');
$params->set('intro_only', 1);
$params->set('hide_author', 1);
$params->set('hide_createdate', 0);
$params->set('hide_modifydate', 1);
// Disable edit ability icon
$access = new stdClass();
$access->canEdit    = 0;
$access->canEditOwn = 0;
$access->canPublish = 0;
$lists = modJvDrawer::getList($params,$access);
$items = count($lists);
if(!count($lists)){
  return ;
}
$style = $params->get('style','default-v');
$item_size = $params->get('item_size','220');
$item_minimized = $params->get('item_minimized','90');
$title = $params->get('title', '');
$moduleWidth = $params->get('module_width',0);
$cssModuleWidth = 'width:'.$moduleWidth.'px';
$module_height   = $params->get('module_height', '150');
$moduleId = 'jv_drawer_wrap'.$module->id;
$eventType = $params->get('type_event');
switch($style){
  case "default":
  default:
  	$item_height         = $item_size - 10;
	$module_height       = $item_size + ($items-1) * $item_minimized + 20;	
	$css_item_height     = 'height: ' . $item_height . 'px;';
	$css_module_height   = 'height: ' . $module_height . 'px;';
	$item_shift          = $item_size - $item_minimized -10;	
    require(JModuleHelper::getLayoutPath('mod_jv_drawer', 'default-v'));
    break;
  case "photo-h":      
    $item_width          = $item_size;
    $item_height         = $module_height;
    $module_width        = $item_size + ($items-1) * $item_minimized;    
    $css_item_width      = 'width: ' . $item_width . 'px;';
    $css_item_height     = 'height: ' . $item_height . 'px;';
    $css_module_width    = 'width: ' . $module_width . 'px;';
    $css_module_height   = 'height: ' . $module_height . 'px;';
    // js parameters
    $item_shift          = $item_size - $item_minimized + 10;   
    require(JModuleHelper::getLayoutPath('mod_jv_drawer', 'photo-h'));
    break;
  case "photo-v":   
    $item_height = $item_size;
    $module_height = $item_height +($items -1)*$item_minimized;
    $css_item_height = 'height: '.$item_height.'px';
    $css_module_height = 'height: '.$module_height.'px';
    $item_shift = $item_size-$item_minimized + 10;
    require(JModuleHelper::getLayoutPath('mod_jv_drawer', 'photo-v'));
    break;      
}
$css = JURI::base().'modules/mod_jv_drawer/styles/'.$style.'/style.css';
$document =& JFactory::getDocument();
$document->addStyleSheet($css);
$js = JURI::base().'modules/mod_jv_drawer/styles/js/jv_drawer.js';
$document->addScript($js);
?>